#ifndef __CRYLANLOBBY_H__
#define __CRYLANLOBBY_H__

#if _MSC_VER > 1000
#pragma once
#endif

#include "Lobby/CryLobby.h"
#include "Lobby/CryTCPServiceFactory.h"
#include "Lobby/LAN/CryLANMatchMaking.h"
#include "Lobby/CryReward.h"

enum CryLANLobbyPacketType
{
	eLANPT_SessionRequestJoinResult = eLobbyPT_SessionRequestJoinResult,

	eLANPT_MM_RequestServerData = CRYLANLOBBY_PACKET_START,
	eLANPT_MM_ServerData,
	eLANPT_SessionRequestJoin,
	eLANPT_SessionAddRemoteConnections,
	eLANPT_HostMigrationStart,
	eLANPT_HostMigrationServer,
	eLANPT_HostMigrationClient,
	eLANPT_UserData,

	eLANPT_EndType
};

class CCryLANLobbyService : public CCryLobbyService
{
public:
																	CCryLANLobbyService(CCryLobby* pLobby, ECryLobbyService service);

	virtual ECryLobbyError					Initialise(ECryLobbyServiceFeatures features, CryLobbyServiceCallback pCB);
	virtual ECryLobbyError					Terminate(ECryLobbyServiceFeatures features, CryLobbyServiceCallback pCB);
	virtual void										Tick(CTimeValue tv);
	virtual ICryMatchMaking*				GetMatchMaking()							{ return m_pMatchmaking; }
	virtual ICryVoice*							GetVoice()										{ return NULL; }
	virtual ICryReward*							GetReward()										{ return NULL; }
	virtual ICryStats*							GetStats()										{ return NULL; }
	virtual ICryLobbyUI*						GetLobbyUI()									{ return NULL; }
	virtual ICryFriends*						GetFriends()									{ return NULL; }
	virtual ICryFriendsManagement*	GetFriendsManagement()				{ return NULL; }
	virtual	CryUserID								GetUserID(uint32 user)				{ return CryUserInvalidID; }	
	virtual ECryLobbyError					GetSystemTime(uint32 user, SCrySystemTime* pSystemTime);

	virtual void										OnPacket(const TNetAddress& addr, CCryLobbyPacket* pPacket);
	virtual void										OnError(const TNetAddress& addr, ESocketError error, CryLobbySendID sendID);
	virtual void										OnSendComplete(const TNetAddress& addr, CryLobbySendID sendID);

private:
	_smart_ptr<CCryLANMatchMaking>	m_pMatchmaking;
};

#endif // __CRYLANLOBBY_H__
